package com.example.mapper;

import com.example.entity.OrganizationMember;
import com.example.entity.SelectMemberDTO;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 操作organization_member相关数据接口
*/
public interface OrganizationMemberMapper {

    /**
      * 新增
    */
    int insert(OrganizationMember organizationMember);

    /**
      * 删除
    */
    int deleteById(Integer id);

    /**
      * 修改
    */
    int updateById(OrganizationMember organizationMember);

    /**
      * 根据ID查询
    */
    OrganizationMember selectById(Integer id);

    /**
      * 查询所有
    */
    List<OrganizationMember> selectAll(OrganizationMember organizationMember);

    @Select("SELECT * FROM organization_member WHERE user_id = #{userId}")
    OrganizationMember getByUserId(Long userId);

    List<OrganizationMember> selectMember(SelectMemberDTO selectMemberDTO);
}